{extend name='app' /}
{block name='title'}管理员列表{/block}

{block name="stylesheet"}
<link href="{__ADMIN__}/css/plugins/steps/jquery.steps.css" rel="stylesheet">
{/block}


{block name="breadcrumb"}
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2>管理员列表</h2>
        <ol class="breadcrumb">
            <li class="breadcrumb-item">
                <a>权限管理</a>
            </li>
            <li class="breadcrumb-item active">
                <strong>管理员列表</strong>
            </li>
        </ol>
    </div>
</div>
{/block}


{block name="content"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">

                <form id="block-search">
                    <div class="row ">
                        <div class="col-sm-2">
                            <div class="form-group">
                                <label class="control-label">用户名</label>
                                <input placeholder="请输入用户名" type="text" class="form-control" name="account_name" value="{$search['account_name'] ?? ''}">
                            </div>
                        </div>

                        <div class="col-sm-2">
                            <div class="form-group">
                                <label class="control-label">手机号码</label>
                                <input placeholder="请输入手机号码" type="text" class="form-control" name="mobile" value="{$search['mobile'] ?? ''}">
                            </div>
                        </div>
                    </div>

                    <div class="row m-b-lg">
                        <div class="col-sm btn-group-search">
                            <button class="btn btn-primary btn-sm" type="submit">确定</button>
                            <button class="btn btn-white btn-sm btn-reset" type="button">重置</button>
                        </div>
                    </div>
                </form>

                <div class="ibox-content">

                    <div class="row">
                        <div class="col-sm m-b-sm">
                                <span class="float-left">
                                    <button class="btn btn-primary btn-sm" type="button" onclick="get_html($(this),'{$Think.config.admin.app_host}/admin/account/create')"><i class="fa fa-plus"></i>&nbsp;
                                        添加
                                    </button>
                                </span>
                            <span class="float-right btn-group">
                                    <button class="btn btn-white btn-sm btn-outline btn-search" type="button"><i class="fa fa-search"></i>&nbsp;
                                        搜索
                                    </button>
                            </span>
                        </div>
                    </div>
                    <div class="table-responsive">
                        <table class="table table-bordered table-hover">
                            <thead>
                            <tr>
                                <th>#</th>
                                <th>用户名</th>
                                <th>头像</th>
                                <th>所属组别</th>
                                <th>管理项目</th>
                                <th>真实姓名</th>
                                <th>手机号码</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {foreach $list as $index => $item}
                            <tr>
                                <td>{++$index}</td>
                                <td>{$item->name}</td>
                                <td>
                                    <img src="{notempty name='$item->headimg'}{$item->headimg}{else /} {__ADMIN__}/dist/img/default-headimg.jpg {/notempty}" alt="" class="rounded img-md">
                                </td>
                                <td>
                                    {foreach $item->group_ids as $val}
                                        <span class="label label-success">{$group[$val]}</span>
                                    {/foreach}
                                </td>
                                <td>
                                    {foreach $item->project_ids as $val}
                                        {foreach $project as $value}
                                          {if $value['id'] == $val}
                                            <span class="label label-primary">{$value->name}</span>
                                          {/if}
                                        {/foreach}
                                    {/foreach}
                                </td>
                                <td>{$item->realname}</td>
                                <td>{$item->mobile}</td>
                                <td>
                                    {if $item->status == '1'}
                                        <span class="text-navy"><i class="fa fa-circle"></i>&nbsp;正常</span>
                                    {else/}
                                        <span class="text-danger"><i class="fa fa-circle"></i>&nbsp;冻结</span>
                                    {/if}
                                </td>
                                <td>
                                    <button class="btn btn-info btn-xs" type="button" onclick="get_html($(this),'{$Think.config.admin.app_host}/admin/account/{$item->id}/edit')"><i class="fa fa-pencil"></i>&nbsp;编辑
                                    </button>
                                </td>
                            </tr>
                            {/foreach}
                            </tbody>
                        </table>
                        <div class="float-right">
                            {$list|raw}
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>
{/block}

{block name="script"}
<script src="{__ADMIN__}/js/plugins/steps/jquery.steps.min.js"></script>
{/block}
